cmake_minimum_required(VERSION 3.14)
project(CGGetPicture1)

set(CMAKE_CXX_STANDARD 11)


find_path(AVCODEC_INCLUDE_DIR libavcodec/avcodec.h)
find_library(AVCODEC_LIBRARY avcodec)

find_path(AVFORMAT_INCLUDE_DIR libavformat/avformat.h)
find_library(AVFORMAT_LIBRARY avformat)

find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h )
find_library(AVUTIL_LIBRARY avutil)

find_path(AVFILTER_INCLUDE_DIR libavfilter/avfilter.h )
find_library(AVFILTER_LIBRARY avfilter)

find_path(AVDEVICE_INCLUDE_DIR libavdevice/avdevice.h)
find_library(AVDEVICE_LIBRARY avdevice)

find_path(SWSCALE_INCLUDE_DIR libswscale/swscale.h)
find_library(SWSCALE_LIBRARY swscale)



INCLUDE_DIRECTORIES( # List of preprocessor include file search directories. 预处理程序列表包括文件搜索目录。
    E:/Dev/ffmpeg/include/
)

LINK_DIRECTORIES( #List of linker search directories. 链接器搜索目录列表。
    E:/Dev/ffmpeg/lib/
)

add_executable(${PROJECT_NAME} CGGetPicture.cpp)


#Add include directories to a target.
target_include_directories(${PROJECT_NAME}  PRIVATE ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${AVDEVICE_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR} ${AVFILTER_INCLUDE_DIR})

target_link_libraries(${PROJECT_NAME}         PRIVATE        ${AVCODEC_LIBRARY}        ${AVFORMAT_LIBRARY}        ${AVUTIL_LIBRARY}        ${AVDEVICE_LIBRARY}        ${SWSCALE_LIBRARY}        ${AVFILTER_LIBRARY}        )